package com.lykj.llw.box.adapter.sale

import android.view.View
import android.widget.TextView
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lykj.lib_base.component.GlideApp
import com.lykj.llw.box.R
import com.lykj.llw.box.data.bean.response.RecyclingRecordResponse

/**
 * ================================================
 * 小号(角色)回收记录适配器
 * ================================================
 *
 * @author gosha
 * @date 2023/10/23-15:29
 */
class RecyclingRecordAdapter :
    BaseQuickAdapter<RecyclingRecordResponse.DataDTO.RowsDTO, BaseViewHolder>(R.layout.item_reuse_record) {

    override fun convert(holder: BaseViewHolder, item: RecyclingRecordResponse.DataDTO.RowsDTO) {
        holder.setText(R.id.tv_role_name, "${item.roleName}")
        holder.setText(R.id.tv_server_name, "区服：${item.serverName}")
        holder.setText(R.id.tv_role_id, "ID：${item.roleId}")

        GlideApp.with(context)
            .load(item.gameIcon)
            .transition(DrawableTransitionOptions.withCrossFade())
            .into(holder.getView(R.id.iv_icon))
    }
}